<layout name="Common/layout"/>

<link rel="stylesheet" href="__PUBLIC__/Home/style/order.css" type="text/css">
<link rel="stylesheet" href="__PUBLIC__/Home/style/home.css" type="text/css">
<script type="text/javascript" src="__PUBLIC__/Home/js/home.js"></script>

<include file="Common/nav"/>

<!-- 页面主体 start -->
<div class="main w1210 bc mt10">
    <div class="crumb w1210">
        <h2><span>首页 </span><span>> 我的订单</span></h2>
    </div>

<include file="My/menu"/>

    <!-- 右侧内容区域 start -->
    <div class="content fl ml10">
        <div class="order_hd">
            <h3>订单号：<?php echo $order['order_sn']; ?></h3>
        </div>

        <div class="order_bd mt10">

            <!--订单详情开始-->
            <table class="orders">
                <thead>
                <tr>
                    <th width="10%">商品名称</th>
                    <th width="20%">商品图片</th>
                    <th width="10%">商品规格</th>
                    <th width="10%">商品数量</th>
                    <th width="15%">商品单价</th>
                </tr>
                </thead>
                <tbody>
                <?php foreach($order['goods_list'] as $k => $v): ?>
                <tr>
                    <td><?php echo $v['goods_name']; ?></td>
                    <td><?php showImage($v['sm_logo'],'goods/','logo/'); ?></td>
                    <td>
                        <?php foreach($v['gaData'] as $k1 => $v1): ?>
                        <p><?php echo $v1['attr_name'];?>:<?php echo $v1['attr_value'];?></p>
                        <?php endforeach; ?>
                    </td>
                    <td><?php echo $v['goods_number']; ?></td>
                    <td><?php echo $v['price']; ?></td>
                </tr>
                <?php endforeach; ?>
                </tbody>
            </table>
            <!--订单详情结束-->
            <br>

            <table class="orders">
                <tbody>
                    <tr>
                        <td colspan="<?php if($order['post_status']==1):?>5<?php else:?>6<?php endif;?>">
                            <span>收货人：<?php echo $order['shr_name'];?></span>
                            <span style="margin-left:20px;">收货电话：<?php echo $order['shr_tel'];?></span>
                            <span style="margin-left:20px;">收货地址：<?php echo $order['shr_province'];?>
                                <?php echo $order['shr_city'];?> <?php echo $order['shr_area'];?>
                                <?php echo $order['shr_address'];?>
                            </span>
                            <span style="margin-left:20px;">快递单号：<?php echo $order['post_number'];?></span>
                        </td>
                        <?php if($order['post_status'] == 1):?>
                        <td>
                            <p class="alipaysubmit">
                                <a href="<?php echo U('My/setReceived',array('id'=>$order['id']));?>"
                                onclick="if(confirm('您确认要收货？')){return true;}else{return false;}">确认收货</a>
                            </p>
                        </td>
                        <?php endif;?>
                    </tr>
                    <tr>
                        <td colspan="4">
                            订单总价：<span style="font-size:20px;color:red;"><?php echo $order['total_price'];?></span>，
                            下单时间：<?php echo date('Y-m-d H:i:s',$order['addtime']);?>
                        </td>
                        <td width="10%">
                            <?php if($order['order_status']=='正常'):?>
                                <?php if($order['pay_status']=='是'):?>
                                    <?php echo $order['post_status']==1 ? '已发货' : ($order['post_status']==2 ? '已签收' : '未发货');?>
                                <?php else:?>
                            <a href="<?php echo U('Order/pay?id='.$v['id']);?>" style="font-size: 15px">支付</a>
                                <?php endif; ?>
                            <?php else:?>
                                已取消
                            <?php endif; ?>
                        </td>
                        <td width="5%"><a href="<?php echo U('My/order');?>">返回</a></td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <!-- 右侧内容区域 end -->
</div>
<!-- 页面主体 end-->
<include file="Common/help"/>


